#ifndef _SAT_H_
#define _SAT_H_

// utilities and system includes
#include <CL/cl.h>
#include <CL/cl_platform.h>
#include <CL/cl_ext.h>
#include <CL/opencl.h>

#include <cmath>
#include <cstdlib>
#include <cstdio>
#include "util.h"


#define ERR_CHECK(errcode, str) \
	if ((errcode) != CL_SUCCESS) fprintf(stderr, "%s:%u: %s=%s\n", __FILE__, __LINE__, str, oclErrorString(errcode))

typedef struct SAT_test {
	cl_context hContext;
	cl_command_queue hCmdQueue;
	cl_kernel hSATScanKernel; 
	cl_kernel hTransposeKernel; 
	cl_float4 * hst_src;
	cl_mem dev_src;
	cl_float4 * hst_dst;
	cl_mem dev_dst;
	size_t blockSize;
	size_t maxBlockSize;
	int num;
	double time;
	double scan_time;
	double transpose_time;
	bool split;
	FILE* csv;
} SAT_test_t;

double launch_SAT(SAT_test_t * t);

#endif // #ifndef _SAT_H_